﻿using drawing_print.form;
using drawing_print.util;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace drawing_print.configure
{
    class AppConfig
    {
        /// <summary>
        /// 文件存放路径
        /// </summary>
        public static string FiliPath = Path.Combine(Application.StartupPath, "FiliPath");
        /// <summary>
        /// source 源文件
        /// </summary>
        public static string SourceFilePath;
        /// <summary>
        /// 文件类型
        /// </summary>
        public static string FileExtension;
        /// <summary>
        /// target 目标文件
        /// </summary>
        public static string TargetFilePath = Path.Combine(FiliPath, "target.pdf");
        /// <summary>
        /// 图片文件夹
        /// </summary>
        public static string ImagePath = Path.Combine(FiliPath, "Image");
        /// <summary>
        /// 所有图片
        /// </summary>
        public static List<Bitmap> ImageList = new List<Bitmap>();
        /// <summary>
        /// 是否在工作
        /// </summary>
        public static bool isWork;

        public static Log log = new Log(Path.Combine(Application.StartupPath, "log.txt"));

        public static string EndPath = Path.Combine(FiliPath, "end.pdf");

        //public static Form form = new Form1();//声明窗体类的静态变量

        public static void initialization()
        {

            if (Directory.Exists(FiliPath))
            {
                DirectoryInfo subdir = new DirectoryInfo(FiliPath);
                subdir.Delete(true);          //删除子目录和文件
            }
            Directory.CreateDirectory(FiliPath);
            Directory.CreateDirectory(ImagePath);
        }
    }
}
